home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / INTERNET / SITES / RAND / UNSPLIT / text0787.txt < prev    next >
Encoding:
Text File  |  1997-02-06  |  3.4 KB  |  69 lines

  1.  
  2. > But surely it isn't that hard to do Doom movement? Wall colision can be
  3. > handled by the same routine as player collision, I think, and working out
  4. > the direction to move isn't that hard, is it? 
  5.  
  6. Unfortunately, there's quite a difference between bumping into walls and
  7. actually avoiding them in the first place. Path finding algorithms are needed
  8. to prevent monsters from trying to walk through walls to get to their target
  9. (normally this is either the object's enemy or the 2-sided linedef forming the
  10. exit from that sector and entrance to another).
  11.  
  12. > Are the line of sight test routines still (at least partially) valid? The AI
  13. > guys wanted LOS routines for their algo's...
  14.  
  15. 2 dimensional LOS can be calculated fairly easily because the walls are simple
  16. lines. You only have to intersect the projected line of sight with the wall
  17. segments between you and your target. Usually, the blockmap can be filled with
  18. close-proximity walls to make wall checks a lot less intensive.
  19.  
  20. Unfortunately, 3D LOS is not so easy because you then have to intersect the
  21. (previously 2D) line of sight against the floors and ceilings. This
  22. is to ensure a monster can't see through a very high step or closed door. There
  23. is probably a way to make this simple, but I haven't spent any time thinking
  24. about it in detail.
  25.  
  26. >I also wonder whether it would be OK to use the routines in Wolf3D.
  27.  
  28. I don't think there's much in Wolf we can use to be honest. All the hard
  29. bits are going to be just as hard because they are system-specific, and Wolf
  30. & Doom both use different systems. Wolf can use simple grid-maps to track
  31. the environment and LOS is reducable to intersections against horizontal and
  32. vertical lines. There are also no height differences, so most of it is 
  33. actually quite trivial. The only thing that stops them just using a block
  34. map for the whole game is the fact that secret walls can slide very smoothly
  35. between start and end positions. Otherwise it would just be a ray-casted
  36. version of Dungeon Master!
  37.  
  38. The only thing you could get out of it is ideas for how to make the guys
  39. 'react' to different situations. From what I remember of Wolf, there's not
  40. much of this either. We're probably much better off making it up as we go
  41. along. It's worked for me so far... :)))
  42.  
  43. The most difficult bits will be the intelligence 'decision' logic - it's the
  44. hardest part to write and by far the hardest to test. The actual 2D & 3D algos
  45. are insular components and can be written & checked without too many problems.
  46.  
  47. I wrote a (non-trivial) 2D line intersection routine for a reverse painter
  48. algorithm last year - this may come in handy for BM. Unfortunatly, the equations
  49. needed for solving a non-trivial 3D line against an arbitrary plane is a little
  50. more complex to reduce into code. I haven't written one of these yet, and we may
  51. need this for perfect LOS.
  52.  
  53. BTW, 'non-trivial' means it is not restricted to requiring at least one vertical
  54. or horizontal line in order to work. It relies on simultaneous equations. This
  55. is why a 3D version is a bit of a minor nightmare in assembly language, and still
  56. relatively obnoxious in 'C'. 
  57.  
  58. I think we may get away with 3D intersections against an axial plane (flat floor)
  59. and 2D intersections for the walls if the floor test fails. Some internal/external
  60. checks should sort out the final answer from these two results.
  61.  
  62. Ignore me if I'm jabbering - I'm just thinking on my feet, and besides, it's about
  63. 7.00 in the morning and I've been working all night! I need some sleep!
  64.  
  65. :)
  66.  
  67. Doug.
  68.  
  69.